package advice;

import org.apache.log4j.Logger;
import org.springframework.aop.AfterReturningAdvice;

import java.lang.reflect.Method;

public class AfterAdvice implements AfterReturningAdvice {
    //后置增强

    //日志对象
    private static Logger logger =  Logger.getLogger(AfterAdvice.class);


    @Override
    public void afterReturning(Object result, Method method, Object[] objects, Object target) throws Throwable {
        //result方法的返回值 method方法名 objects参数 target目标对象
        System.out.println("调用了"+target+"的"+method.getName()+"方法,方法的返回值是"+result);


    }
}
